<template>
	<view>
	
		<view class="bg display-between-center padding-bottom-border" style="padding: 0 30rpx;">
			<view class="text">姓名</view>
			<input type="text" value="" v-model="user.nickname" placeholder="请输入姓名" class="font-size-28 text-right" placeholder-class="placeholder-class" />
			
		</view>
	
		<view class="bg display-between-center padding-bottom-border" style="padding-right: 30rpx;">
			<view class="text">手机号码</view>
			
			<input type="text" v-model="user.phone" maxlength="18" placeholder="请输入手机号" class="font-size-28 text-right" placeholder-class="placeholder-class" />
		</view>
		
		
		
		<view class="bg display-between-center padding-bottom-border" style="padding-right: 30rpx;">
			<view class="text">联创等级</view>
			
			<picker style="width: 80%; text-align: right;" @change="bindPickerChange" :value="index" :range="array">
									<view class="uni-input">{{array[index]}}</view>
								</picker>
		</view>
		
		
		<view class="btn" @tap="save">
			确认提交
		</view>
		
		
		<!-- 选择地区 -->
		<u-picker mode="region" v-model="show_add" :area-code='["13", "1303", "130304"]' @confirm="select_address"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{
					phone:'',
					nickname:'',
				},
				array: ['联创1', '联创2', '联创3'],
				index:0
			
			}
		},
		onShow(){
			// this.save()
			// this.user.nickName = uni.getStorageSync('nickName')
			// this.user.imgss = uni.getStorageSync('portrait')
			// console.log(uni.getStorageSync('nickName'),'454545');
		},
		onLoad() {
			
		},
		methods: {
			 bindPickerChange: function(e) {
			            console.log('picker发送选择改变，携带值为', e.detail.value)
			            this.index = e.detail.value
			        },
			
			
			save(){
				var post_data={};
				post_data.user_name=this.user.nickname;
				post_data.mobile=this.user.phone;
				post_data.apply_type=this.index+1;
				
				this.$myRequest({
					url: 'api/user/user_add_apply',
					method:'POST',
					data:post_data,
				}).then(res => {
					uni.showToast({
						icon:'none',
						title:res.data.msg
					})
					if(res.data.code==1){
						setTimeout(function() {
							uni.navigateBack({
								data:1
							})
						}, 2000);
						// uni.setStorageSync('nickName',res.data.data.nickname)
						// uni.setStorageSync('portrait',res.data.data.portrait)
						
					}
				})
			}
		},
	}
</script>

<style lang="scss">
page{
	background-color: #FAFAFA;
	// width: 93%;
	margin: auto;
	color:#333333;
	.btn{
		margin-top: 40rpx;
		button{
			height: 88rpx;
			background: #4567F2;
			border-radius: 4px;
			font-size: 30rpx;
			color: #FFFFFF;
		}
	}
	.text{
		font-size: 28rpx;
		color: #333;
	}
	.idCardUp{
		margin: 40rpx 0 24rpx 0;
		font-size: 28rpx;
		color: #333333;
	}
	.idCardBox{
		display: flex;
		justify-content: space-between;
		.idCardText{
			font-size: 20rpx;
			color: #999999;
			text-align: center;
		}
	}
	.personal{
		image{
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
		}
	}
	input{
		width: 80%;
	}
	.btn{
		height: 50px;
		line-height: 50px;
		text-align: center;
		background: #FF9101;
		font-size: 16px;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		opacity: 1;
		border-radius: 32px;
		margin-bottom: 10px;
	}
}
</style>
